<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/11/30
 * Time: 11:18
 */

namespace app\console\model;


use think\Model;

class Service extends Model
{
    protected $insert = ['create_time' => '2011-02-16 11:11:11'];
//    protected $autoWriteTimestamp = 'datetime';

    protected function setCreateTimeAttr()
    {
        return date('Y-m-d H:i:s',time());
    }


    public function Shop(){
        return $this->belongsTo('Shop');
    }
    public function Member(){
        return $this->belongsTo('Member');
    }
    public function Single(){
//        halt(debug_backtrace()[0]['function']);
        return $this->belongsTo(debug_backtrace()[0]['function']);
    }
    protected function getStatusaAttr($value,$data){
        $status = [-1=>'取消订单',1=>'预约中',2=>'已到店','3' => '已完成'];
        return $status[$data['status']];
    }










}